how to iterate array of objects in javascript using map